package xyz.labradormm.spider.util;

import java.util.function.BiFunction;

/**
 * @author huanghaojian
 * @description
 * @date 2023-12-12 0:02
 */
public class TryUtil {

    public static <T, U, R> R tryGetValue(T obj, U param, BiFunction<T, U, R> function) {
        try {
            return function.apply(obj, param);
        } catch (Exception e) {
            return null;
        }
    }

}
